# -*- coding: utf-8 -*-
# @Time     : 2021/11/27 9:07
# @Author   : wljess
# @File     : 冒泡排序.py
# @Describe : 
# @Software : PyCharm


def bulled_sort(li):
    '''
    冒泡排序
    :param li: 待排序列表
    :return:
    '''

    for i in range(len(li) - 1):  # 循环n躺
        for j in range(len(li) - i - 1):  # 每趟找到最大元素
            if li[j] > li[j + 1]:
                li[j], li[j+1] = li[j+1], li[j]

    return li


if __name__ == '__main__':
    lst = [92, 18, 45, 36, 9, 8, 7, 19, 20, 35, 102, 36]
    print(bulled_sort(lst))
